import uiautomator2 as u2
import time,os

# d = u2.connect('127.0.0.1:62001')
# print(d.info)
# print(d.device_info)
# d.app_start("uni.UNIC181310")
# time.sleep(5)
# 对app进行操作

# d=u2.connect("127.0.0.1:62001")
# d.app_start("com.miui.calculator")
# time.sleep(2)
# d(resourceId="com.miui.calculator:id/btn_c_s").click()
# w,h=d.window_size()
# d(text="8").click()
# time.sleep(2)
# d.click(400, 100)
# s=d.session("com.miui.calculator",attach=True)
# time.sleep(2)
# s(text="9" ).click()
# s.click( w*0.5,h*0.8)
# #d .app_stop_aLL()
# s.make_toast(text='本次测试已经完成.', duration=3.0)

d = u2.connect('127.0.0.1:62001')
d.app_install('https://app.mi.com/download/1254516?id=com.qingliu.browser&ref=appstore.mobile_download&nonce=5365441021485609156%3A26990579&appClientId=2882303761517485445&appSignature=7wZittzQ5W7wPj6deNEfAcd0b9a4_VAZJzRouHeSiKY')







